package com.ruoyi.mall.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.PrimaryKeyIdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.OrderReturnDetailMapper;
import com.ruoyi.mall.domain.OrderReturnDetail;
import com.ruoyi.mall.service.IOrderReturnDetailService;

/**
 * 订单退货细则Service业务层处理
 * 
 * @author luogongquan
 * @date 2024-11-20
 */
@Service
public class OrderReturnDetailServiceImpl implements IOrderReturnDetailService 
{
    @Autowired
    private OrderReturnDetailMapper orderReturnDetailMapper;

    /**
     * 查询订单退货细则
     * 
     * @param id 订单退货细则主键
     * @return 订单退货细则
     */
    @Override
    public OrderReturnDetail selectOrderReturnDetailById(Long id)
    {
        return orderReturnDetailMapper.selectOrderReturnDetailById(id);
    }

    /**
     * 查询订单退货细则列表
     * 
     * @param orderReturnDetail 订单退货细则
     * @return 订单退货细则
     */
    @Override
    public List<OrderReturnDetail> selectOrderReturnDetailList(OrderReturnDetail orderReturnDetail)
    {
        return orderReturnDetailMapper.selectOrderReturnDetailList(orderReturnDetail);
    }

    /**
     * 新增订单退货细则
     * 
     * @param orderReturnDetail 订单退货细则
     * @return 结果
     */
    @Override
    public int insertOrderReturnDetail(OrderReturnDetail orderReturnDetail)
    {
        orderReturnDetail.setId(PrimaryKeyIdUtils.getSysIdWorker().nextId());
        orderReturnDetail.setCreateTime(DateUtils.getNowDate());
        return orderReturnDetailMapper.insertOrderReturnDetail(orderReturnDetail);
    }

    /**
     * 修改订单退货细则
     * 
     * @param orderReturnDetail 订单退货细则
     * @return 结果
     */
    @Override
    public int updateOrderReturnDetail(OrderReturnDetail orderReturnDetail)
    {
        return orderReturnDetailMapper.updateOrderReturnDetail(orderReturnDetail);
    }

    /**
     * 批量删除订单退货细则
     * 
     * @param ids 需要删除的订单退货细则主键
     * @return 结果
     */
    @Override
    public int deleteOrderReturnDetailByIds(Long[] ids)
    {
        return orderReturnDetailMapper.deleteOrderReturnDetailByIds(ids);
    }

    /**
     * 删除订单退货细则信息
     * 
     * @param id 订单退货细则主键
     * @return 结果
     */
    @Override
    public int deleteOrderReturnDetailById(Long id)
    {
        return orderReturnDetailMapper.deleteOrderReturnDetailById(id);
    }
}
